{% extends 'dashboard/layout.html' %}
{% load category_tags %}
{% load i18n %}
{% load render_table from django_tables2 %}

{% block body_class %}{{ block.super }} catalogue{% endblock %}

{% block title %}
    {% trans "Categories" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        </li>
        <li class="active">{% trans "Categories" %}</li>
    </ul>
{% endblock %}

{% block header %}
    <div class="page-header">
        <a href="{% url 'dashboard:catalogue-category-create' %}" class="btn btn-primary btn-lg pull-right"><i class="icon-plus"></i> {% trans "Create new category" %}</a>
        <h1>{% trans "Categories" %}</h1>
    </div>
{% endblock header %}

{% block dashboard_content %}
    <div class="alert alert-info">
        <p>{% trans "You are editing:" %}
            <strong><a href="{% url 'dashboard:catalogue-category-list' %}">{% trans "Home" %}</a></strong>
            {% if ancestors %}
                &gt;
                {% for ancestor in ancestors %}
                    <strong><a href="{% url 'dashboard:catalogue-category-detail-list' pk=ancestor.pk %}">{{ ancestor.name }}</a></strong>{% if not forloop.last %} > {% endif %}
                {% endfor %}
            {% endif %}
        </p>
    </div>

    {% render_table categories %}

    {% if not child_categories %}
        <p>{% trans "There are no categories." %}</p>
    {% endif %}
{% endblock dashboard_content %}
